<?php
if (count($rows)>0) {
	foreach ($rows as $r) {
?>
<div class="program" id="program-<?php echo $r['id']; ?>">
	<div class="points">
		<?php echo $r['required_points']; ?>
	</div>
	<div class="actions">
		<div style="height:32px;">
			<a class="btn btn-mini program-delete" data-id="<?php echo $r['id']; ?>" onclick="eventTrash(this)" style="display:none;">
				<i class="icon-trash bigger-120"></i>
			</a>
		</div>
		<?php if ($r['status'] == 1) { ?>
		<i class="icon-ok-circle icon-5x program-published"></i>
		<a class="btn btn-info program-publish" data-id="<?php echo $r['id']; ?>" style="display:none;">
			<i class="icon-rss bigger-110"></i> <b><?php echo BUtils::T('publish_btn') ?></b>
		</a>
		<?php } else { ?>
		<i class="icon-ok-circle icon-5x program-published" style="display:none;"></i>
		<a class="btn btn-info program-publish" data-id="<?php echo $r['id']; ?>" onclick="eventPublish(this)">
			<i class="icon-rss bigger-110"></i> <b><?php echo BUtils::T('publish_btn') ?></b>
		</a>
		<?php } ?>
	</div>
	<div class="content">
		<div class="title"><?php echo strip_tags($r['title']); ?></div>
		<div class="desc"><?php echo strip_tags($r['description']); ?></div>
	</div>
	<div class="clearfix"></div>
</div>
<?php
	}
} else {
?>
<div class="well well-large gray">
	<h3 class=""><?php echo BUtils::T('loyalty_program_no_msg'); ?></h3>
	<p></p>
</div>
<?php
}
?>
<script type="text/javascript">
$(function() {
	$('.program').mouseenter(function(){
		$(this).find('.program-delete').show();
	}).mouseleave(function(){
		$(this).find('.program-delete').hide();
	});
});
</script>